<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />
<div class="form-horizontal">
  <div class="form-group">
    <label class="control-label col-xs-2">总购买人数：</label>
    <div class="col-xs-4 pull-left"  style="width: 30%;">
      <p class="form-control-static">${distributor.purchaserTotal}</p>
    </div>
  </div>
  <div class="form-group">
    <label class="control-label col-xs-2">总奖励(RMB)：</label>
    <div class="col-xs-4 pull-left">
      <p class="form-control-static"><fmt:formatNumber value="${distributor.kickbackTotal/100}" maxFractionDigits="2" pattern="0.00"/></p>
    </div>
  </div>
</div>

<table class="table table-striped table-hover x-table" style="margin-bottom:20px;">
  <thead>
    <tr>
      <th>订单号</th>
      <th>产品</th>
      <th>份数</th>
      <th>原价(RMB)</th>
      <th>回扣(RMB)</th>
    </tr>
  </thead>
  <tbody>
    <c:forEach var="relation" items="${relations}">
      <tr>
        <td>${relation.order.code}</td>
        <td>${relation.order.product.name}</td>
        <td>${relation.order.amount}</td>
        <td><fmt:formatNumber value="${relation.order.price/100}" maxFractionDigits="2" pattern="0.00"/></td>
        <td><fmt:formatNumber value="${relation.earnedPrice/100}" maxFractionDigits="2" pattern="0.00"/></td>
      </tr>
    </c:forEach>
  </tbody>
</table>